import {FC, forwardRef, useEffect, useRef} from "react";
import WebviewTag = Electron.WebviewTag;
const {apiPlatform} =window['server']
const CusWebview = forwardRef((props, ref) => {
    const douenc = useRef<WebviewTag>(null);
    useEffect(() => {
        const webview = douenc.current;
        if (webview) {
            const onDomReady = async () => {
                console.log("webview加载了")
            };
            webview.addEventListener("dom-ready", onDomReady, true);
            return () => {
                if (webview) {
                    webview.removeEventListener("dom-ready", onDomReady);
                }
            };
        }
    }, []);
    return <>
        <webview ref={douenc} style='height: calc(100% - 110px)' src="https://mp.v.qq.com/homepage" partition="persist:yx27my8rrn" className='w-full h-full scroll-auto'></webview>
    </>
})
export default CusWebview
